<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GSimpleAsyncResult</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO 参考手册">
<link rel="up" href="async.html" title="Asynchronous I/O">
<link rel="prev" href="gio-GIOScheduler.html" title="GIOScheduler">
<link rel="next" href="conversion.html" title="Data conversion">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gio-GIOScheduler.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="async.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO 参考手册</th>
<td><a accesskey="n" href="conversion.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gio-GSimpleAsyncResult.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gio-GSimpleAsyncResult.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gio-GSimpleAsyncResult"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gio-GSimpleAsyncResult.top_of_page"></a>GSimpleAsyncResult</span></h2>
<p>GSimpleAsyncResult — Simple asynchronous results implementation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gio-GSimpleAsyncResult.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

                    <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult">GSimpleAsyncResult</a>;
<span class="returnvalue">void</span>                (<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()">*GSimpleAsyncThreadFunc</a>)           (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()">g_simple_async_result_new</a>          (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-error" title="g_simple_async_result_new_error ()">g_simple_async_result_new_error</a>    (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-from-error" title="g_simple_async_result_new_from_error ()">g_simple_async_result_new_from_error</a>
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-take-error" title="g_simple_async_result_new_take_error ()">g_simple_async_result_new_take_error</a>
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer" title="g_simple_async_result_set_op_res_gpointer ()">g_simple_async_result_set_op_res_gpointer</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> op_res</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_op_res</code></em>);
<a href="../glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gpointer" title="g_simple_async_result_get_op_res_gpointer ()">g_simple_async_result_get_op_res_gpointer</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gssize" title="g_simple_async_result_set_op_res_gssize ()">g_simple_async_result_set_op_res_gssize</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> op_res</code></em>);
<a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gssize" title="g_simple_async_result_get_op_res_gssize ()">g_simple_async_result_get_op_res_gssize</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gboolean" title="g_simple_async_result_set_op_res_gboolean ()">g_simple_async_result_set_op_res_gboolean</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> op_res</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gboolean" title="g_simple_async_result_get_op_res_gboolean ()">g_simple_async_result_get_op_res_gboolean</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<a href="../glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-source-tag" title="g_simple_async_result_get_source_tag ()">g_simple_async_result_get_source_tag</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-is-valid" title="g_simple_async_result_is_valid ()">g_simple_async_result_is_valid</a>      (<em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-handle-cancellation" title="g_simple_async_result_set_handle_cancellation ()">g_simple_async_result_set_handle_cancellation</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> handle_cancellation</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete" title="g_simple_async_result_complete ()">g_simple_async_result_complete</a>      (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()">g_simple_async_result_complete_in_idle</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-run-in-thread" title="g_simple_async_result_run_in_thread ()">g_simple_async_result_run_in_thread</a> (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()"><span class="type">GSimpleAsyncThreadFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-from-error" title="g_simple_async_result_set_from_error ()">g_simple_async_result_set_from_error</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-take-error" title="g_simple_async_result_take_error ()">g_simple_async_result_take_error</a>    (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-propagate-error" title="g_simple_async_result_propagate_error ()">g_simple_async_result_propagate_error</a>
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **dest</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-error" title="g_simple_async_result_set_error ()">g_simple_async_result_set_error</a>     (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-error-va" title="g_simple_async_result_set_error_va ()">g_simple_async_result_set_error_va</a>  (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> args</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-error-in-idle" title="g_simple_async_report_error_in_idle ()">g_simple_async_report_error_in_idle</a> (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-gerror-in-idle" title="g_simple_async_report_gerror_in_idle ()">g_simple_async_report_gerror_in_idle</a>
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-take-gerror-in-idle" title="g_simple_async_report_take_gerror_in_idle ()">g_simple_async_report_take_gerror_in_idle</a>
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gio-GSimpleAsyncResult.description"></a><h2>Description</h2>
<p>
Implements <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> for simple cases. Most of the time, this
will be all an application needs, and will be used transparently.
Because of this, <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> is used throughout GIO for
handling asynchronous functions.
</p>
<p>
GSimpleAsyncResult handles <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>s, error
reporting, operation cancellation and the final state of an operation,
completely transparent to the application. Results can be returned
as a pointer e.g. for functions that return data that is collected
asynchronously, a boolean value for checking the success or failure
of an operation, or a <a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> for operations which return the number
of bytes modified by the operation; all of the simple return cases
are covered.
</p>
<p>
Most of the time, an application will not need to know of the details
of this API; it is handled transparently, and any necessary operations
are handled by <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>'s interface. However, if implementing a
new GIO module, for writing language bindings, or for complex
applications that need better control of how asynchronous operations
are completed, it is important to understand this functionality.
</p>
<p>
GSimpleAsyncResults are tagged with the calling function to ensure
that asynchronous functions and their finishing functions are used
together correctly.
</p>
<p>
To create a new <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>, call <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()"><code class="function">g_simple_async_result_new()</code></a>.
If the result needs to be created for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, use
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-from-error" title="g_simple_async_result_new_from_error ()"><code class="function">g_simple_async_result_new_from_error()</code></a> or
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-take-error" title="g_simple_async_result_new_take_error ()"><code class="function">g_simple_async_result_new_take_error()</code></a>. If a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is not available
(e.g. the asynchronous operation's doesn't take a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> argument),
but the result still needs to be created for an error condition, use
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new-error" title="g_simple_async_result_new_error ()"><code class="function">g_simple_async_result_new_error()</code></a> (or <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-error-va" title="g_simple_async_result_set_error_va ()"><code class="function">g_simple_async_result_set_error_va()</code></a>
if your application or binding requires passing a variable argument list
directly), and the error can then be propagated through the use of
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-propagate-error" title="g_simple_async_result_propagate_error ()"><code class="function">g_simple_async_result_propagate_error()</code></a>.
</p>
<p>
An asynchronous operation can be made to ignore a cancellation event by
calling <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-handle-cancellation" title="g_simple_async_result_set_handle_cancellation ()"><code class="function">g_simple_async_result_set_handle_cancellation()</code></a> with a
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> for the operation and <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. This is useful for
operations that are dangerous to cancel, such as close (which would
cause a leak if cancelled before being run).
</p>
<p>
GSimpleAsyncResult can integrate into GLib's event loop, <a href="../glib/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>,
or it can use <a href="../glib/glib-Threads.html#GThread"><span class="type">GThread</span></a>s if available.
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete" title="g_simple_async_result_complete ()"><code class="function">g_simple_async_result_complete()</code></a> will finish an I/O task directly
from the point where it is called. <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a>
will finish it from an idle handler in the <GTKDOCLINK HREF="g-main-context-push-thread-default">thread-default main
context</GTKDOCLINK>. <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-run-in-thread" title="g_simple_async_result_run_in_thread ()"><code class="function">g_simple_async_result_run_in_thread()</code></a> will run the
job in a separate thread and then deliver the result to the
thread-default main context.
</p>
<p>
To set the results of an asynchronous function,
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gpointer" title="g_simple_async_result_set_op_res_gpointer ()"><code class="function">g_simple_async_result_set_op_res_gpointer()</code></a>,
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gboolean" title="g_simple_async_result_set_op_res_gboolean ()"><code class="function">g_simple_async_result_set_op_res_gboolean()</code></a>, and
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-op-res-gssize" title="g_simple_async_result_set_op_res_gssize ()"><code class="function">g_simple_async_result_set_op_res_gssize()</code></a>
are provided, setting the operation's result to a gpointer, gboolean, or
gssize, respectively.
</p>
<p>
Likewise, to get the result of an asynchronous function,
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gpointer" title="g_simple_async_result_get_op_res_gpointer ()"><code class="function">g_simple_async_result_get_op_res_gpointer()</code></a>,
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gboolean" title="g_simple_async_result_get_op_res_gboolean ()"><code class="function">g_simple_async_result_get_op_res_gboolean()</code></a>, and
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-get-op-res-gssize" title="g_simple_async_result_get_op_res_gssize ()"><code class="function">g_simple_async_result_get_op_res_gssize()</code></a> are
provided, getting the operation's result as a gpointer, gboolean, and
gssize, respectively.
</p>
<p>
For the details of the requirements implementations must respect, see
<a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.  A typical implementation of an asynchronous operation
using GSimpleAsyncResult looks something like this:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
static void
baked_cb (Cake    *cake,
          gpointer user_data)
{
  /* In this example, this callback is not given a reference to the cake, so
   * the GSimpleAsyncResult has to take a reference to it.
   */
  GSimpleAsyncResult *result = user_data;

  if (cake == NULL)
    g_simple_async_result_set_error (result,
                                     BAKER_ERRORS,
                                     BAKER_ERROR_NO_FLOUR,
                                     "Go to the supermarket");
  else
    g_simple_async_result_set_op_res_gpointer (result,
                                               g_object_ref (cake),
                                               g_object_unref);


  /* In this example, we assume that baked_cb is called as a callback from
   * the mainloop, so it's safe to complete the operation synchronously here.
   * If, however, _baker_prepare_cake () might call its callback without
   * first returning to the mainloop — inadvisable, but some APIs do so —
   * we would need to use g_simple_async_result_complete_in_idle().
   */
  g_simple_async_result_complete (result);
  g_object_unref (result);
}

void
baker_bake_cake_async (Baker              *self,
                       guint               radius,
                       GAsyncReadyCallback callback,
                       gpointer            user_data)
{
  GSimpleAsyncResult *simple;
  Cake               *cake;

  if (radius &lt; 3)
    {
      g_simple_async_report_error_in_idle (G_OBJECT (self),
                                           callback,
                                           user_data,
                                           BAKER_ERRORS,
                                           BAKER_ERROR_TOO_SMALL,
                                           "%ucm radius cakes are silly",
                                           radius);
      return;
    }

  simple = g_simple_async_result_new (G_OBJECT (self),
                                      callback,
                                      user_data,
                                      baker_bake_cake_async);
  cake = _baker_get_cached_cake (self, radius);

  if (cake != NULL)
    {
      g_simple_async_result_set_op_res_gpointer (simple,
                                                 g_object_ref (cake),
                                                 g_object_unref);
      g_simple_async_result_complete_in_idle (simple);
      g_object_unref (simple);
      /* Drop the reference returned by _baker_get_cached_cake(); the
       * GSimpleAsyncResult has taken its own reference.
       */
      g_object_unref (cake);
      return;
    }

  _baker_prepare_cake (self, radius, baked_cb, simple);
}

Cake *
baker_bake_cake_finish (Baker        *self,
                        GAsyncResult *result,
                        GError      **error)
{
  GSimpleAsyncResult *simple;
  Cake               *cake;

  g_return_val_if_fail (g_simple_async_result_is_valid (result,
                                                        G_OBJECT (self),
                                                        baker_bake_cake_async),
                        NULL);

  simple = (GSimpleAsyncResult *) result;

  if (g_simple_async_result_propagate_error (simple, error))
    return NULL;

  cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
  return g_object_ref (cake);
}
</pre></div>
<p>
</p>
</div>
<div class="refsect1">
<a name="gio-GSimpleAsyncResult.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GSimpleAsyncResult"></a><h3>GSimpleAsyncResult</h3>
<pre class="programlisting">typedef struct _GSimpleAsyncResult GSimpleAsyncResult;</pre>
<p>
A simple implementation of <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GSimpleAsyncThreadFunc"></a><h3>GSimpleAsyncThreadFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GSimpleAsyncThreadFunc)           (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
<p>
Simple thread function that runs an asynchronous operation and
checks for cancellation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>optional <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-new"></a><h3>g_simple_async_result_new ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * g_simple_async_result_new          (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);</pre>
<p>
Creates a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_tag</code></em> :</span></p></td>
<td>the asynchronous function.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-new-error"></a><h3>g_simple_async_result_new_error ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * g_simple_async_result_new_error    (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Creates a new <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> with a set error.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
<td>an error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>a string with format characters.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>a list of values to insert into <em class="parameter"><code>format</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-new-from-error"></a><h3>g_simple_async_result_new_from_error ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * g_simple_async_result_new_from_error
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Creates a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> from an error condition.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-new-take-error"></a><h3>g_simple_async_result_new_take_error ()</h3>
<pre class="programlisting"><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="returnvalue">GSimpleAsyncResult</span></a> * g_simple_async_result_new_take_error
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source_object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Creates a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> from an error condition, and takes over the
caller's ownership of <em class="parameter"><code>error</code></em>, so the caller does not need to free it anymore.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.28</p>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-op-res-gpointer"></a><h3>g_simple_async_result_set_op_res_gpointer ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_op_res_gpointer
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> op_res</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_op_res</code></em>);</pre>
<p>
Sets the operation result within the asynchronous result to a pointer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>op_res</code></em> :</span></p></td>
<td>a pointer result from an asynchronous function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy_op_res</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> function.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-get-op-res-gpointer"></a><h3>g_simple_async_result_get_op_res_gpointer ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_simple_async_result_get_op_res_gpointer
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Gets a pointer result as returned by the asynchronous function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer from the result.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-op-res-gssize"></a><h3>g_simple_async_result_set_op_res_gssize ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_op_res_gssize
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> op_res</code></em>);</pre>
<p>
Sets the operation result within the asynchronous result to
the given <em class="parameter"><code>op_res</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>op_res</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-get-op-res-gssize"></a><h3>g_simple_async_result_get_op_res_gssize ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>              g_simple_async_result_get_op_res_gssize
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Gets a gssize from the asynchronous result.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a gssize returned from the asynchronous function.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-op-res-gboolean"></a><h3>g_simple_async_result_set_op_res_gboolean ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_op_res_gboolean
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> op_res</code></em>);</pre>
<p>
Sets the operation result to a boolean within the asynchronous result.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>op_res</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-get-op-res-gboolean"></a><h3>g_simple_async_result_get_op_res_gboolean ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_simple_async_result_get_op_res_gboolean
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Gets the operation result boolean from within the asynchronous result.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the operation's result was <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
if the operation's result was <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-get-source-tag"></a><h3>g_simple_async_result_get_source_tag ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            g_simple_async_result_get_source_tag
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Gets the source tag for the <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> to the source object for the <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-is-valid"></a><h3>g_simple_async_result_is_valid ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_simple_async_result_is_valid      (<em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
                                                         <em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *source</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> source_tag</code></em>);</pre>
<p>
Ensures that the data passed to the _finish function of an async
operation is consistent.  Three checks are performed.
</p>
<p>
First, <em class="parameter"><code>result</code></em> is checked to ensure that it is really a
<a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.  Second, <em class="parameter"><code>source</code></em> is checked to ensure that it
matches the source object of <em class="parameter"><code>result</code></em>.  Third, <em class="parameter"><code>source_tag</code></em> is
checked to ensure that it is either <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (as it is when the result was
created by <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-error-in-idle" title="g_simple_async_report_error_in_idle ()"><code class="function">g_simple_async_report_error_in_idle()</code></a> or
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-gerror-in-idle" title="g_simple_async_report_gerror_in_idle ()"><code class="function">g_simple_async_report_gerror_in_idle()</code></a>) or equal to the
<em class="parameter"><code>source_tag</code></em> argument given to <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-new" title="g_simple_async_result_new ()"><code class="function">g_simple_async_result_new()</code></a> (which, by
convention, is a pointer to the _async function corresponding to the
_finish function from which this function is called).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>the <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> passed to the _finish function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>the <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> passed to the _finish function.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source_tag</code></em> :</span></p></td>
<td>the asynchronous function.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><span class="type">TRUE</span></a> if all checks passed or <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><span class="type">FALSE</span></a> if any failed.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.20</p>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-handle-cancellation"></a><h3>g_simple_async_result_set_handle_cancellation ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_handle_cancellation
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> handle_cancellation</code></em>);</pre>
<p>
Sets whether to handle cancellation within the asynchronous operation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle_cancellation</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-complete"></a><h3>g_simple_async_result_complete ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_complete      (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Completes an asynchronous I/O job immediately. Must be called in
the thread where the asynchronous result was to be delivered, as it
invokes the callback directly. If you are in a different thread use
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a>.
</p>
<p>
Calling this function takes a reference to <em class="parameter"><code>simple</code></em> for as long as
is needed to complete the call.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-complete-in-idle"></a><h3>g_simple_async_result_complete_in_idle ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_complete_in_idle
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>);</pre>
<p>
Completes an asynchronous function in an idle handler in the <GTKDOCLINK HREF="g-main-context-push-thread-default">thread-default main
loop</GTKDOCLINK> of the thread that <em class="parameter"><code>simple</code></em> was initially created in.
</p>
<p>
Calling this function takes a reference to <em class="parameter"><code>simple</code></em> for as long as
is needed to complete the call.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-run-in-thread"></a><h3>g_simple_async_result_run_in_thread ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_run_in_thread (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()"><span class="type">GSimpleAsyncThreadFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> io_priority</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
<p>
Runs the asynchronous job in a separate thread and then calls
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-complete-in-idle" title="g_simple_async_result_complete_in_idle ()"><code class="function">g_simple_async_result_complete_in_idle()</code></a> on <em class="parameter"><code>simple</code></em> to return
the result to the appropriate main loop.
</p>
<p>
Calling this function takes a reference to <em class="parameter"><code>simple</code></em> for as long as
is needed to run the job and report its completion.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncThreadFunc" title="GSimpleAsyncThreadFunc ()"><span class="type">GSimpleAsyncThreadFunc</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io_priority</code></em> :</span></p></td>
<td>the io priority of the request.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>optional <a class="link" href="gio-GCancellable.html#GCancellable" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-from-error"></a><h3>g_simple_async_result_set_from_error ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_from_error
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Sets the result from a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-take-error"></a><h3>g_simple_async_result_take_error ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_take_error    (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Sets the result from <em class="parameter"><code>error</code></em>, and takes over the caller's ownership
of <em class="parameter"><code>error</code></em>, so the caller does not need to free it any more.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.28</p>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-propagate-error"></a><h3>g_simple_async_result_propagate_error ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_simple_async_result_propagate_error
                                                        (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **dest</code></em>);</pre>
<p>
Propagates an error from within the simple asynchronous result to
a given destination.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td>a location to propagate the error to. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the error was propagated to <em class="parameter"><code>dest</code></em>. <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-error"></a><h3>g_simple_async_result_set_error ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_error     (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Sets an error within the asynchronous result without a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
<td>an error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>a formatted error reporting string.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>a list of variables to fill in <em class="parameter"><code>format</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-result-set-error-va"></a><h3>g_simple_async_result_set_error_va ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_result_set_error_va  (<em class="parameter"><code><a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a> *simple</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>
Sets an error within the asynchronous result without a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.
Unless writing a binding, see <a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-result-set-error" title="g_simple_async_result_set_error ()"><code class="function">g_simple_async_result_set_error()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>simple</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GSimpleAsyncResult.html#GSimpleAsyncResult" title="GSimpleAsyncResult"><span class="type">GSimpleAsyncResult</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
<td>an error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>a formatted error reporting string.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
<td>va_list of arguments.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-report-error-in-idle"></a><h3>g_simple_async_report_error_in_idle ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_report_error_in_idle (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> domain</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> code</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Reports an error in an asynchronous function in an idle function by
directly setting the contents of the <a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a> with the given error
information.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> containing the error domain (usually <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a>).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>code</code></em> :</span></p></td>
<td>a specific error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>a formatted error reporting string.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>a list of variables to fill in <em class="parameter"><code>format</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-report-gerror-in-idle"></a><h3>g_simple_async_report_gerror_in_idle ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_report_gerror_in_idle
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Reports an error in an idle function. Similar to
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-error-in-idle" title="g_simple_async_report_error_in_idle ()"><code class="function">g_simple_async_report_error_in_idle()</code></a>, but takes a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> rather
than building a new one.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>the <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to report</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="g-simple-async-report-take-gerror-in-idle"></a><h3>g_simple_async_report_take_gerror_in_idle ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_simple_async_report_take_gerror_in_idle
                                                        (<em class="parameter"><code><a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Reports an error in an idle function. Similar to
<a class="link" href="gio-GSimpleAsyncResult.html#g-simple-async-report-gerror-in-idle" title="g_simple_async_report_gerror_in_idle ()"><code class="function">g_simple_async_report_gerror_in_idle()</code></a>, but takes over the caller's
ownership of <em class="parameter"><code>error</code></em>, so the caller does not have to free it any more.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>a <a href="../gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>a <a class="link" href="gio-GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>callback</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>the <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to report</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.28</p>
</div>
</div>
<div class="refsect1">
<a name="gio-GSimpleAsyncResult.see-also"></a><h2>See Also</h2>
<a class="link" href="gio-GAsyncResult.html#GAsyncResult" title="GAsyncResult"><span class="type">GAsyncResult</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>